#include "yacc_parser/Item.h"
#include "yacc_parser/Atom.h"


Item::Item( Atom * pAtom )
{
	m_oAtoms.push_back(pAtom);
}
Item::~Item(void)
{
	std::vector<Atom *>::iterator it;
	for(it = m_oAtoms.begin(); m_oAtoms.end()!= it ; ++ it)
	{
		delete (*it);
	}
}

void Item::addAtom( Atom *pAtom )
{
	m_oAtoms.push_back(pAtom);
}

std::vector<Atom *> & Item::getAtoms()
{
	return m_oAtoms;
}

std::string Item::toString()
{
	std::string str;
	std::vector<Atom *>::iterator it;
	for(it = m_oAtoms.begin(); m_oAtoms.end()!= it ; ++ it)
	{
		str +=(*it)->toString() + " ";
	}
	return str;
}

